<template>
	<el-table :data="$store.state.app.list" :height="tableHeight" :max-height="tableHeight" 
		size="small" border highlight-current-row
		style="width: 100%">
		<el-table-column type="index" label="序号" width="50"></el-table-column>
		<el-table-column label="时间" prop="createTime"></el-table-column>
		<el-table-column label="楼栋" prop="domitoryId"></el-table-column>
		<el-table-column label="学工号" prop="xgh"></el-table-column>
		<el-table-column label="是否通行" >
			<template slot-scope="scope">
				<el-tag :type="scope.row.success ? 'primary' : 'danger'">{{scope.row.success ? '成功' : '失败'}}</el-tag>
			</template>
		</el-table-column>
		<el-table-column label="失败日志" prop="msg"></el-table-column>
	</el-table>
</template>

<script>
import store from '@/store';
import cfg from './js/';
import Page from '@/components/permission/Page.js';

export default {
	store: cfg.store,
	data() {
		return {};
	},
	methods: {
		add() {
			this.$emit('add');
		},
		renderHeaderModify() {
			const directives = [{
				name: "permission", value: ['access-control:door:add']
			}];
			return (
				<div>
					<el-button size="mini" type="primary" plain onClick={this.add} 
						{...{directives}}>添加楼栋
						<i class="el-icon-plus"></i>
					</el-button>
				</div>
			)
		}
	},
	computed: {
		tableHeight() {
			return window.innerHeight - 200;
		}
	}
}
</script>